package org.ipb.controller.modul.kelompokpengguna;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.ipb.model.KelompokPengguna;

import util.hibernate.DAO;

import com.opensymphony.xwork2.ActionSupport;

public class ActionJsonMap extends ActionSupport {
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private Map<Integer, String> list = new HashMap<Integer, String>();

	// private List<Agama> list;
	@SuppressWarnings("unchecked")
	public String execute() {
		DAO<Integer> dao = new DAO<Integer>();
		dao.createCriteria(KelompokPengguna.class);
	
		List<KelompokPengguna> listTable = (List<KelompokPengguna>) dao.find();

		for (KelompokPengguna f : listTable) {
			list.put(f.getId(), f.getNama());
		}
		dao.close();
		return SUCCESS;
	}

	public Map<Integer, String> getList() {
		return list;
	}

	public void setList(Map<Integer, String> list) {
		this.list = list;
	}
}
